﻿#region File Description
///------------------------------------------------------------------
/// Program		  :	Algorithm With Graph
/// Written by	  :	Nguyen Khac Trung, Le Hoang Tuan
/// Email		  :	nkt1321991@gmail.com || hoangtuanuit@gmail.com
/// File Name     : WindowChoose2point.cs
/// Created date  :	10/11/2011
/// Modified by	  :	Nguyen Khac Trung
/// Modified date :	11/11/2011
/// Version		  :	1.2
/// Description	  :	Declare my class Point
///------------------------------------------------------------------
#endregion 

#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
#endregion

namespace Graph
{
    /// <summary>
    /// Interaction logic for WindowChoose2point.xaml
    /// </summary>
    public partial class WindowChoose2point : Window
    {
        public WindowChoose2point()
        {
            InitializeComponent();
        }

        private void btn_OK_Click(object sender, RoutedEventArgs e)
        {
            if (comboBoxStartPoint.SelectedIndex < 1 || comboBoxEndPoint.SelectedIndex < 1)
            {
                MessageBox.Show("VUI LÒNG CHỌN CẢ 2 ĐIỂM ĐẦU VÀ KẾT THÚC ĐỂ BẮT ĐẦU!");
                return;
            }

            if (comboBoxStartPoint.SelectedIndex == comboBoxEndPoint.SelectedIndex)
            {
                MessageBox.Show("VUI LÒNG CHỌN 2 ĐIỂM ĐẦU VÀ KẾT THÚC KHÁC NHAU!");
                return;
            }

            this.Tag = comboBoxStartPoint.Text + " " + comboBoxEndPoint.Text;
            this.Close();
        }

        private void btn_cancel_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
